#ifndef _PROP_H_
#define _PROP_H_
#include <MyString.h>

enum Effect
{
    Frozen,//冰冻
    SuckBlood,//吸血
    Reflex,//反伤
};

enum PropType
{
    Weapon,
    Defence,
    Medicament,
};

typedef struct Prop
{
    enum PropType type;//道具类型
    void* ptr;//指向道具对象的指针
}prop;

prop * CreateProp(enum PropType type, void *ptr);
void FreeProp(void *p, void(* clearPtr)(void *));

 
typedef struct Weapon
{
    MyStr name;
    int attack;
    int crit;
    enum Effect effect;
}weapon;

weapon*  CreateWeapon(const char *name,int attack,int crit, enum Effect effect );
void FreeWeapon(void *ptr);
MyStr WeaponToString(weapon *w);


typedef struct Defence
{
    MyStr name;
    int def;
    int parry;
    enum Effect effect;

}defence;



defence *CreateDefence(const char *name,int def,int parry, enum Effect effect);
void FreeDefence(void *ptr);
MyStr DefenceToString(defence *d);


typedef struct Medicament
{
    MyStr name;
    int hp;
    int attack;
    int def;
    int crit;
    int parry;
    enum Effect effect;
}medicament;

 
medicament *CreateMedicament(const char *name,int hp,int attack,int def,int crit,int parry, enum Effect effect);
void FreeMedicament(void *ptr);
MyStr MedicamentToString(medicament *m);



#endif